home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / CIncludes / HFSVolumes.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-17  |  19.5 KB  |  503 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        HFSVolumes.h
  3.  
  4.      Contains:    On-disk data structures for HFS and HFS Plus volumes.
  5.  
  6.      Version:    Technology:    Mac OS 8.1
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1984-1998 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __HFSVOLUMES__
  18. #define __HFSVOLUMES__
  19.  
  20. #ifndef __MACTYPES__
  21. #include <MacTypes.h>
  22. #endif
  23. #ifndef __FILES__
  24. #include <Files.h>
  25. #endif
  26. #ifndef __FINDER__
  27. #include <Finder.h>
  28. #endif
  29.  
  30.  
  31.  
  32. #if PRAGMA_ONCE
  33. #pragma once
  34. #endif
  35.  
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif
  39.  
  40. #if PRAGMA_IMPORT
  41. #pragma import on
  42. #endif
  43.  
  44. #if PRAGMA_STRUCT_ALIGN
  45.     #pragma options align=mac68k
  46. #elif PRAGMA_STRUCT_PACKPUSH
  47.     #pragma pack(push, 2)
  48. #elif PRAGMA_STRUCT_PACK
  49.     #pragma pack(2)
  50. #endif
  51.  
  52. /* Signatures used to differentiate between HFS and HFS Plus volumes */
  53.  
  54. enum {
  55.     kHFSSigWord                    = 0x4244,                        /* 'BD' in ASCII */
  56.     kHFSPlusSigWord                = 0x482B,                        /* 'H+' in ASCII */
  57.     kHFSPlusVersion                = 0x0004,                        /* will change as format changes (version 4 shipped with Mac OS 8.1) */
  58.     kHFSPlusMountVersion        = FOUR_CHAR_CODE('8.10')        /* will change as implementations change ('8.10' in Mac OS 8.1) */
  59. };
  60.  
  61.  
  62. /* CatalogNodeID is used to track catalog objects */
  63. typedef UInt32                             HFSCatalogNodeID;
  64. /* Unicode strings are used for file and folder names (HFS Plus only) */
  65.  
  66. struct HFSUniStr255 {
  67.     UInt16                             length;                        /* number of unicode characters */
  68.     UniChar                         unicode[255];                /* unicode characters */
  69. };
  70. typedef struct HFSUniStr255                HFSUniStr255;
  71.  
  72. typedef const HFSUniStr255 *            ConstHFSUniStr255Param;
  73.  
  74. enum {
  75.     kHFSMaxVolumeNameChars        = 27,
  76.     kHFSMaxFileNameChars        = 31,
  77.     kHFSPlusMaxFileNameChars    = 255
  78. };
  79.  
  80.  
  81. /* Extent overflow file data structures */
  82. /* HFS Extent key */
  83.  
  84. struct HFSExtentKey {
  85.     UInt8                             keyLength;                    /* length of key, excluding this field */
  86.     UInt8                             forkType;                    /* 0 = data fork, FF = resource fork */
  87.     HFSCatalogNodeID                 fileID;                        /* file ID */
  88.     UInt16                             startBlock;                    /* first file allocation block number in this extent */
  89. };
  90. typedef struct HFSExtentKey                HFSExtentKey;
  91. /* HFS Plus Extent key */
  92.  
  93. struct HFSPlusExtentKey {
  94.     UInt16                             keyLength;                    /* length of key, excluding this field */
  95.     UInt8                             forkType;                    /* 0 = data fork, FF = resource fork */
  96.     UInt8                             pad;                        /* make the other fields align on 32-bit boundary */
  97.     HFSCatalogNodeID                 fileID;                        /* file ID */
  98.     UInt32                             startBlock;                    /* first file allocation block number in this extent */
  99. };
  100. typedef struct HFSPlusExtentKey            HFSPlusExtentKey;
  101. /* Number of extent descriptors per extent record */
  102.  
  103. enum {
  104.     kHFSExtentDensity            = 3,
  105.     kHFSPlusExtentDensity        = 8
  106. };
  107.  
  108. /* HFS extent descriptor */
  109.  
  110. struct HFSExtentDescriptor {
  111.     UInt16                             startBlock;                    /* first allocation block */
  112.     UInt16                             blockCount;                    /* number of allocation blocks */
  113. };
  114. typedef struct HFSExtentDescriptor        HFSExtentDescriptor;
  115. /* HFS Plus extent descriptor */
  116.  
  117. struct HFSPlusExtentDescriptor {
  118.     UInt32                             startBlock;                    /* first allocation block */
  119.     UInt32                             blockCount;                    /* number of allocation blocks */
  120. };
  121. typedef struct HFSPlusExtentDescriptor    HFSPlusExtentDescriptor;
  122. /* HFS extent record */
  123.  
  124. typedef HFSExtentDescriptor             HFSExtentRecord[3];
  125. /* HFS Plus extent record */
  126. typedef HFSPlusExtentDescriptor         HFSPlusExtentRecord[8];
  127.  
  128. /* Fork data info (HFS Plus only) - 80 bytes */
  129.  
  130. struct HFSPlusForkData {
  131.     UInt64                             logicalSize;                /* fork's logical size in bytes */
  132.     UInt32                             clumpSize;                    /* fork's clump size in bytes */
  133.     UInt32                             totalBlocks;                /* total blocks used by this fork */
  134.     HFSPlusExtentRecord             extents;                    /* initial set of extents */
  135. };
  136. typedef struct HFSPlusForkData            HFSPlusForkData;
  137. /* Permissions info (HFS Plus only) - 16 bytes */
  138.  
  139. struct HFSPlusPermissions {
  140.     UInt32                             ownerID;                    /* user or group ID of file/folder owner */
  141.     UInt32                             groupID;                    /* additional user of group ID */
  142.     UInt32                             permissions;                /* permissions (bytes: unused, owner, group, everyone) */
  143.     UInt32                             specialDevice;                /* UNIX: device for character or block special file */
  144. };
  145. typedef struct HFSPlusPermissions        HFSPlusPermissions;
  146. /* Catalog file data structures */
  147.  
  148. enum {
  149.     kHFSRootParentID            = 1,                            /* Parent ID of the root folder */
  150.     kHFSRootFolderID            = 2,                            /* Folder ID of the root folder */
  151.     kHFSExtentsFileID            = 3,                            /* File ID of the extents file */
  152.     kHFSCatalogFileID            = 4,                            /* File ID of the catalog file */
  153.     kHFSBadBlockFileID            = 5,                            /* File ID of the bad allocation block file */
  154.     kHFSAllocationFileID        = 6,                            /* File ID of the allocation file (HFS Plus only) */
  155.     kHFSStartupFileID            = 7,                            /* File ID of the startup file (HFS Plus only) */
  156.     kHFSAttributesFileID        = 8,                            /* File ID of the attribute file (HFS Plus only) */
  157.     kHFSBogusExtentFileID        = 15,                            /* Used for exchanging extents in extents file */
  158.     kHFSFirstUserCatalogNodeID    = 16
  159. };
  160.  
  161.  
  162. /* HFS catalog key */
  163.  
  164. struct HFSCatalogKey {
  165.     UInt8                             keyLength;                    /* key length (in bytes) */
  166.     UInt8                             reserved;                    /* reserved (set to zero) */
  167.     HFSCatalogNodeID                 parentID;                    /* parent folder ID */
  168.     Str31                             nodeName;                    /* catalog node name */
  169. };
  170. typedef struct HFSCatalogKey            HFSCatalogKey;
  171. /* HFS Plus catalog key */
  172.  
  173. struct HFSPlusCatalogKey {
  174.     UInt16                             keyLength;                    /* key length (in bytes) */
  175.     HFSCatalogNodeID                 parentID;                    /* parent folder ID */
  176.     HFSUniStr255                     nodeName;                    /* catalog node name */
  177. };
  178. typedef struct HFSPlusCatalogKey        HFSPlusCatalogKey;
  179.  
  180. /* Catalog record types */
  181.  
  182. enum {
  183.                                                                 /* HFS Catalog Records */
  184.     kHFSFolderRecord            = 0x0100,                        /* Folder record */
  185.     kHFSFileRecord                = 0x0200,                        /* File record */
  186.     kHFSFolderThreadRecord        = 0x0300,                        /* Folder thread record */
  187.     kHFSFileThreadRecord        = 0x0400,                        /* File thread record */
  188.                                                                 /* HFS Plus Catalog Records */
  189.     kHFSPlusFolderRecord        = 1,                            /* Folder record */
  190.     kHFSPlusFileRecord            = 2,                            /* File record */
  191.     kHFSPlusFolderThreadRecord    = 3,                            /* Folder thread record */
  192.     kHFSPlusFileThreadRecord    = 4                                /* File thread record */
  193. };
  194.  
  195.  
  196. /* Catalog file record flags */
  197.  
  198. enum {
  199.     kHFSFileLockedBit            = 0x0000,                        /* file is locked and cannot be written to */
  200.     kHFSFileLockedMask            = 0x0001,
  201.     kHFSThreadExistsBit            = 0x0001,                        /* a file thread record exists for this file */
  202.     kHFSThreadExistsMask        = 0x0002
  203. };
  204.  
  205.  
  206. /* HFS catalog folder record - 70 bytes */
  207.  
  208. struct HFSCatalogFolder {
  209.     SInt16                             recordType;                    /* record type */
  210.     UInt16                             flags;                        /* folder flags */
  211.     UInt16                             valence;                    /* folder valence */
  212.     HFSCatalogNodeID                 folderID;                    /* folder ID */
  213.     UInt32                             createDate;                    /* date and time of creation */
  214.     UInt32                             modifyDate;                    /* date and time of last modification */
  215.     UInt32                             backupDate;                    /* date and time of last backup */
  216.     DInfo                             userInfo;                    /* Finder information */
  217.     DXInfo                             finderInfo;                    /* additional Finder information */
  218.     UInt32                             reserved[4];                /* reserved - set to zero */
  219. };
  220. typedef struct HFSCatalogFolder            HFSCatalogFolder;
  221. /* HFS Plus catalog folder record - 88 bytes */
  222.  
  223. struct HFSPlusCatalogFolder {
  224.     SInt16                             recordType;                    /* record type = HFS Plus folder record */
  225.     UInt16                             flags;                        /* file flags */
  226.     UInt32                             valence;                    /* folder's valence (limited to 2^16 in Mac OS) */
  227.     HFSCatalogNodeID                 folderID;                    /* folder ID */
  228.     UInt32                             createDate;                    /* date and time of creation */
  229.     UInt32                             contentModDate;                /* date and time of last content modification */
  230.     UInt32                             attributeModDate;            /* date and time of last attribute modification */
  231.     UInt32                             accessDate;                    /* date and time of last access (Rhapsody only) */
  232.     UInt32                             backupDate;                    /* date and time of last backup */
  233.     HFSPlusPermissions                 permissions;                /* permissions (for Rhapsody) */
  234.     DInfo                             userInfo;                    /* Finder information */
  235.     DXInfo                             finderInfo;                    /* additional Finder information */
  236.     UInt32                             textEncoding;                /* hint for name conversions */
  237.     UInt32                             reserved;                    /* reserved - set to zero */
  238. };
  239. typedef struct HFSPlusCatalogFolder        HFSPlusCatalogFolder;
  240. /* HFS catalog file record - 102 bytes */
  241.  
  242. struct HFSCatalogFile {
  243.     SInt16                             recordType;                    /* record type */
  244.     UInt8                             flags;                        /* file flags */
  245.     SInt8                             fileType;                    /* file type (unused ?) */
  246.     FInfo                             userInfo;                    /* Finder information */
  247.     HFSCatalogNodeID                 fileID;                        /* file ID */
  248.     UInt16                             dataStartBlock;                /* not used - set to zero */
  249.     SInt32                             dataLogicalSize;            /* logical EOF of data fork */
  250.     SInt32                             dataPhysicalSize;            /* physical EOF of data fork */
  251.     UInt16                             rsrcStartBlock;                /* not used - set to zero */
  252.     SInt32                             rsrcLogicalSize;            /* logical EOF of resource fork */
  253.     SInt32                             rsrcPhysicalSize;            /* physical EOF of resource fork */
  254.     UInt32                             createDate;                    /* date and time of creation */
  255.     UInt32                             modifyDate;                    /* date and time of last modification */
  256.     UInt32                             backupDate;                    /* date and time of last backup */
  257.     FXInfo                             finderInfo;                    /* additional Finder information */
  258.     UInt16                             clumpSize;                    /* file clump size (not used) */
  259.     HFSExtentRecord                 dataExtents;                /* first data fork extent record */
  260.     HFSExtentRecord                 rsrcExtents;                /* first resource fork extent record */
  261.     UInt32                             reserved;                    /* reserved - set to zero */
  262. };
  263. typedef struct HFSCatalogFile            HFSCatalogFile;
  264. /* HFS Plus catalog file record - 248 bytes */
  265.  
  266. struct HFSPlusCatalogFile {
  267.     SInt16                             recordType;                    /* record type = HFS Plus file record */
  268.     UInt16                             flags;                        /* file flags */
  269.     UInt32                             reserved1;                    /* reserved - set to zero */
  270.     HFSCatalogNodeID                 fileID;                        /* file ID */
  271.     UInt32                             createDate;                    /* date and time of creation */
  272.     UInt32                             contentModDate;                /* date and time of last content modification */
  273.     UInt32                             attributeModDate;            /* date and time of last attribute modification */
  274.     UInt32                             accessDate;                    /* date and time of last access (Rhapsody only) */
  275.     UInt32                             backupDate;                    /* date and time of last backup */
  276.     HFSPlusPermissions                 permissions;                /* permissions (for Rhapsody) */
  277.     FInfo                             userInfo;                    /* Finder information */
  278.     FXInfo                             finderInfo;                    /* additional Finder information */
  279.     UInt32                             textEncoding;                /* hint for name conversions */
  280.     UInt32                             reserved2;                    /* reserved - set to zero */
  281.  
  282.                                                                 /* start on double long (64 bit) boundry */
  283.     HFSPlusForkData                 dataFork;                    /* size and block data for data fork */
  284.     HFSPlusForkData                 resourceFork;                /* size and block data for resource fork */
  285. };
  286. typedef struct HFSPlusCatalogFile        HFSPlusCatalogFile;
  287. /* HFS catalog thread record - 46 bytes */
  288.  
  289. struct HFSCatalogThread {
  290.     SInt16                             recordType;                    /* record type */
  291.     SInt32                             reserved[2];                /* reserved - set to zero */
  292.     HFSCatalogNodeID                 parentID;                    /* parent ID for this catalog node */
  293.     Str31                             nodeName;                    /* name of this catalog node */
  294. };
  295. typedef struct HFSCatalogThread            HFSCatalogThread;
  296. /* HFS Plus catalog thread record -- 264 bytes */
  297.  
  298. struct HFSPlusCatalogThread {
  299.     SInt16                             recordType;                    /* record type */
  300.     SInt16                             reserved;                    /* reserved - set to zero */
  301.     HFSCatalogNodeID                 parentID;                    /* parent ID for this catalog node */
  302.     HFSUniStr255                     nodeName;                    /* name of this catalog node (variable length) */
  303. };
  304. typedef struct HFSPlusCatalogThread        HFSPlusCatalogThread;
  305.  
  306. /*
  307.       These are the types of records in the attribute B-tree.  The values were chosen
  308.       so that they wouldn't conflict with the catalog record types.
  309. */
  310.  
  311. enum {
  312.     kHFSPlusAttrInlineData        = 0x10,                            /* if size <  kAttrOverflowSize */
  313.     kHFSPlusAttrForkData        = 0x20,                            /* if size >= kAttrOverflowSize */
  314.     kHFSPlusAttrExtents            = 0x30                            /* overflow extents for large attributes */
  315. };
  316.  
  317.  
  318. /*
  319.       HFSPlusAttrInlineData
  320.       For small attributes, whose entire value is stored within this one
  321.       B-tree record.
  322.       There would not be any other records for this attribute.
  323. */
  324.  
  325. struct HFSPlusAttrInlineData {
  326.     UInt32                             recordType;                    /*    = kHFSPlusAttrInlineData*/
  327.     UInt32                             reserved;
  328.     UInt32                             logicalSize;                /*    size in bytes of userData*/
  329.     Byte                             userData[2];                /*    variable length; space allocated is a multiple of 2 bytes*/
  330. };
  331. typedef struct HFSPlusAttrInlineData    HFSPlusAttrInlineData;
  332. /*
  333.       HFSPlusAttrForkData
  334.       For larger attributes, whose value is stored in allocation blocks.
  335.       If the attribute has more than 8 extents, there will be additonal
  336.       records (of type HFSPlusAttrExtents) for this attribute.
  337. */
  338.  
  339. struct HFSPlusAttrForkData {
  340.     UInt32                             recordType;                    /*    = kHFSPlusAttrForkData*/
  341.     UInt32                             reserved;
  342.     HFSPlusForkData                 theFork;                    /*    size and first extents of value*/
  343. };
  344. typedef struct HFSPlusAttrForkData        HFSPlusAttrForkData;
  345. /*
  346.       HFSPlusAttrExtents
  347.       This record contains information about overflow extents for large,
  348.       fragmented attributes.
  349. */
  350.  
  351. struct HFSPlusAttrExtents {
  352.     UInt32                             recordType;                    /*    = kHFSPlusAttrExtents*/
  353.     UInt32                             reserved;
  354.     HFSPlusExtentRecord             extents;                    /*    additional extents*/
  355. };
  356. typedef struct HFSPlusAttrExtents        HFSPlusAttrExtents;
  357. /*    A generic Attribute Record*/
  358.  
  359. union HFSPlusAttrRecord {
  360.     UInt32                             recordType;
  361.     HFSPlusAttrInlineData             inlineData;
  362.     HFSPlusAttrForkData             forkData;
  363.     HFSPlusAttrExtents                 overflowExtents;
  364. };
  365. typedef union HFSPlusAttrRecord            HFSPlusAttrRecord;
  366. /* Key and node lengths */
  367.  
  368. enum {
  369.     kHFSPlusExtentKeyMaximumLength = sizeof(HFSPlusExtentKey) - sizeof(UInt16),
  370.     kHFSExtentKeyMaximumLength    = sizeof(HFSExtentKey) - sizeof(UInt8),
  371.     kHFSPlusCatalogKeyMaximumLength = sizeof(HFSPlusCatalogKey) - sizeof(UInt16),
  372.     kHFSPlusCatalogKeyMinimumLength = kHFSPlusCatalogKeyMaximumLength - sizeof(HFSUniStr255) + sizeof(UInt16),
  373.     kHFSCatalogKeyMaximumLength    = sizeof(HFSCatalogKey) - sizeof(UInt8),
  374.     kHFSCatalogKeyMinimumLength    = kHFSCatalogKeyMaximumLength - sizeof(Str31) + sizeof(UInt8),
  375.     kHFSPlusCatalogMinNodeSize    = 4096,
  376.     kHFSPlusExtentMinNodeSize    = 512,
  377.     kHFSPlusAttrMinNodeSize        = 4096
  378. };
  379.  
  380.  
  381. /* HFS and HFS Plus volume attribute bits */
  382.  
  383. enum {
  384.                                                                 /* Bits 0-6 are reserved (always cleared by MountVol call) */
  385.     kHFSVolumeHardwareLockBit    = 7,                            /* volume is locked by hardware */
  386.     kHFSVolumeUnmountedBit        = 8,                            /* volume was successfully unmounted */
  387.     kHFSVolumeSparedBlocksBit    = 9,                            /* volume has bad blocks spared */
  388.     kHFSVolumeNoCacheRequiredBit = 10,                            /* don't cache volume blocks (i.e. RAM or ROM disk) */
  389.     kHFSBootVolumeInconsistentBit = 11,                            /* boot volume is inconsistent (System 7.6 and later) */
  390.                                                                 /* Bits 12-14 are reserved for future use */
  391.     kHFSVolumeSoftwareLockBit    = 15,                            /* volume is locked by software */
  392.     kHFSVolumeHardwareLockMask    = 1 << kHFSVolumeHardwareLockBit,
  393.     kHFSVolumeUnmountedMask        = 1 << kHFSVolumeUnmountedBit,
  394.     kHFSVolumeSparedBlocksMask    = 1 << kHFSVolumeSparedBlocksBit,
  395.     kHFSVolumeNoCacheRequiredMask = 1 << kHFSVolumeNoCacheRequiredBit,
  396.     kHFSBootVolumeInconsistentMask = 1 << kHFSBootVolumeInconsistentBit,
  397.     kHFSVolumeSoftwareLockMask    = 1 << kHFSVolumeSoftwareLockBit,
  398.     kHFSMDBAttributesMask        = 0x8380
  399. };
  400.  
  401.  
  402. /* Master Directory Block (HFS only) - 162 bytes */
  403. /* Stored at sector #2 (3rd sector) */
  404.  
  405. struct HFSMasterDirectoryBlock {
  406.  
  407.                                                                 /* These first fields are also used by MFS */
  408.  
  409.     UInt16                             drSigWord;                    /* volume signature */
  410.     UInt32                             drCrDate;                    /* date and time of volume creation */
  411.     UInt32                             drLsMod;                    /* date and time of last modification */
  412.     UInt16                             drAtrb;                        /* volume attributes */
  413.     SInt16                             drNmFls;                    /* number of files in root folder */
  414.     UInt16                             drVBMSt;                    /* first block of volume bitmap */
  415.     UInt16                             drAllocPtr;                    /* start of next allocation search */
  416.     UInt16                             drNmAlBlks;                    /* number of allocation blocks in volume */
  417.     SInt32                             drAlBlkSiz;                    /* size (in bytes) of allocation blocks */
  418.     SInt32                             drClpSiz;                    /* default clump size */
  419.     SInt16                             drAlBlSt;                    /* first allocation block in volume */
  420.     UInt32                             drNxtCNID;                    /* next unused catalog node ID */
  421.     SInt16                             drFreeBks;                    /* number of unused allocation blocks */
  422.     Str27                             drVN;                        /* volume name */
  423.  
  424.                                                                 /* Master Directory Block extensions for HFS */
  425.  
  426.     UInt32                             drVolBkUp;                    /* date and time of last backup */
  427.     UInt16                             drVSeqNum;                    /* volume backup sequence number */
  428.     SInt32                             drWrCnt;                    /* volume write count */
  429.     SInt32                             drXTClpSiz;                    /* clump size for extents overflow file */
  430.     SInt32                             drCTClpSiz;                    /* clump size for catalog file */
  431.     SInt16                             drNmRtDirs;                    /* number of directories in root folder */
  432.     SInt32                             drFilCnt;                    /* number of files in volume */
  433.     SInt32                             drDirCnt;                    /* number of directories in volume */
  434.     SInt32                             drFndrInfo[8];                /* information used by the Finder */
  435.     UInt16                             drEmbedSigWord;                /* embedded volume signature (formerly drVCSize) */
  436.     HFSExtentDescriptor             drEmbedExtent;                /* embedded volume location and size (formerly drVBMCSize and drCtlCSize) */
  437.     SInt32                             drXTFlSize;                    /* size of extents overflow file */
  438.     HFSExtentRecord                 drXTExtRec;                    /* extent record for extents overflow file */
  439.     SInt32                             drCTFlSize;                    /* size of catalog file */
  440.     HFSExtentRecord                 drCTExtRec;                    /* extent record for catalog file */
  441. };
  442. typedef struct HFSMasterDirectoryBlock    HFSMasterDirectoryBlock;
  443. /* HFSPlusVolumeHeader (HFS Plus only) - 512 bytes */
  444. /* Stored at sector #2 (3rd sector) and second-to-last sector. */
  445.  
  446. struct HFSPlusVolumeHeader {
  447.     UInt16                             signature;                    /* volume signature == 'H+' */
  448.     UInt16                             version;                    /* current version is kHFSPlusVersion */
  449.     UInt32                             attributes;                    /* volume attributes */
  450.     UInt32                             lastMountedVersion;            /* implementation version which last mounted volume */
  451.     UInt32                             reserved;                    /* reserved - set to zero */
  452.  
  453.     UInt32                             createDate;                    /* date and time of volume creation */
  454.     UInt32                             modifyDate;                    /* date and time of last modification */
  455.     UInt32                             backupDate;                    /* date and time of last backup */
  456.     UInt32                             checkedDate;                /* date and time of last disk check */
  457.  
  458.     UInt32                             fileCount;                    /* number of files in volume */
  459.     UInt32                             folderCount;                /* number of directories in volume */
  460.  
  461.     UInt32                             blockSize;                    /* size (in bytes) of allocation blocks */
  462.     UInt32                             totalBlocks;                /* number of allocation blocks in volume (includes this header and VBM*/
  463.     UInt32                             freeBlocks;                    /* number of unused allocation blocks */
  464.  
  465.     UInt32                             nextAllocation;                /* start of next allocation search */
  466.     UInt32                             rsrcClumpSize;                /* default resource fork clump size */
  467.     UInt32                             dataClumpSize;                /* default data fork clump size */
  468.     HFSCatalogNodeID                 nextCatalogID;                /* next unused catalog node ID */
  469.  
  470.     UInt32                             writeCount;                    /* volume write count */
  471.     UInt64                             encodingsBitmap;            /* which encodings have been use  on this volume */
  472.  
  473.     UInt8                             finderInfo[32];                /* information used by the Finder */
  474.  
  475.     HFSPlusForkData                 allocationFile;                /* allocation bitmap file */
  476.     HFSPlusForkData                 extentsFile;                /* extents B-tree file */
  477.     HFSPlusForkData                 catalogFile;                /* catalog B-tree file */
  478.     HFSPlusForkData                 attributesFile;                /* extended attributes B-tree file */
  479.     HFSPlusForkData                 startupFile;                /* boot file */
  480. };
  481. typedef struct HFSPlusVolumeHeader        HFSPlusVolumeHeader;
  482.  
  483. #if PRAGMA_STRUCT_ALIGN
  484.     #pragma options align=reset
  485. #elif PRAGMA_STRUCT_PACKPUSH
  486.     #pragma pack(pop)
  487. #elif PRAGMA_STRUCT_PACK
  488.     #pragma pack()
  489. #endif
  490.  
  491. #ifdef PRAGMA_IMPORT_OFF
  492. #pragma import off
  493. #elif PRAGMA_IMPORT
  494. #pragma import reset
  495. #endif
  496.  
  497. #ifdef __cplusplus
  498. }
  499. #endif
  500.  
  501. #endif /* __HFSVOLUMES__ */
  502.  
  503.